<!-- 商户信息 -->
<template>
	<view class="container">
		<view class="info-edit1" @tap="toEdit(1)">
			<text>商户信息修改</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		<view class="info-edit" @tap="toEdit(2)">
			<text>商户银行卡修改</text>
			<text class="cell-more yticon icon-you"></text></view>
	</view>
</template>

<script>
	import {checkeditstatus} from "@/api/merchant.js"
	export default{
		components:{},
		data(){
			return {
				type: null
			}
		},
		created() {
			
		},
		onLoad(option) {
			this.type = option.type;
		},
		methods:{
			navTo(url){
				uni.navigateTo({
					url: url
				})
			},
			toEdit(type) {
				uni.showLoading({
					mask:true
				})
				checkeditstatus({
					type:type
				}).then(res => {
					uni.hideLoading()
					if (res.data.check == 1) {
						uni.showToast({
							icon: "none",
							title: "申请审核中，请耐心等待!"
						})
					} else if (res.data.check == 2) {
						if (type == 1) {
							uni.navigateTo({
								url: "./changeFail?msg=" + res.data.mag + "&from=change"
							})
						} else if (type == 2) {
							uni.navigateTo({
								url: "./changeFail?msg=" + res.data.mag + "&from=bankChange"
							})
						}
					} else {
						if (type == 1) {
							uni.navigateTo({
								url: "./shopInfoEdit?type=change"
							})
						} else if (type == 2) {
							uni.navigateTo({
								url: "../bankCardEdit/bankCardEdit"
							})
						}
						
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container{
		width:  91%;
		margin: 40rpx auto;
		.info-edit1{
			border-top: 1px solid #EEEEEE;

		}
		.info-edit{
			border-top: 1px solid #EEEEEE;
			border-bottom: 1px solid #EEEEEE;
		}
		.info-edit,.info-edit1{
			display: flex;
			justify-content: space-between;

			padding: 30rpx 12rpx;
			font-size: 28rpx;
			color: #333333;
			.cell-more{
				color: #E5E5E5;
			}
		}
		
		
	}
</style>

